<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PolkitAgentListener</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="polkit Reference Manual">
<link rel="up" href="ref-authentication-agent-api.html" title="Part V. Authentication Agent API Reference">
<link rel="prev" href="ref-authentication-agent-api.html" title="Part V. Authentication Agent API Reference">
<link rel="next" href="PolkitAgentTextListener.html" title="PolkitAgentTextListener">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="ref-authentication-agent-api.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ref-authentication-agent-api.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">polkit Reference Manual</th>
<td><a accesskey="n" href="PolkitAgentTextListener.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#PolkitAgentListener.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#PolkitAgentListener.description" class="shortcut">Description</a>
                   | 
                  <a href="#PolkitAgentListener.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="PolkitAgentListener"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="PolkitAgentListener.top_of_page"></a>PolkitAgentListener</span></h2>
<p>PolkitAgentListener — Abstract base class for Authentication Agents</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="PolkitAgentListener.stability-level"></a><h2>Stability Level</h2>
Unstable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<a name="PolkitAgentListener.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">                    <a class="link" href="PolkitAgentListener.html#PolkitAgentListener-struct" title="PolkitAgentListener">PolkitAgentListener</a>;
struct              <a class="link" href="PolkitAgentListener.html#PolkitAgentListenerClass" title="struct PolkitAgentListenerClass">PolkitAgentListenerClass</a>;
<span class="returnvalue">void</span>                <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication" title="polkit_agent_listener_initiate_authentication ()">polkit_agent_listener_initiate_authentication</a>
                                                        (<em class="parameter"><code><a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action_id</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *icon_name</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitDetails.html" title="PolkitDetails"><span class="type">PolkitDetails</span></a> *details</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> *identities</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication-finish" title="polkit_agent_listener_initiate_authentication_finish ()">polkit_agent_listener_initiate_authentication_finish</a>
                                                        (<em class="parameter"><code><a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> *res</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
enum                <a class="link" href="PolkitAgentListener.html#PolkitAgentRegisterFlags" title="enum PolkitAgentRegisterFlags">PolkitAgentRegisterFlags</a>;
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-register" title="polkit_agent_listener_register ()">polkit_agent_listener_register</a>      (<em class="parameter"><code><a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitAgentListener.html#PolkitAgentRegisterFlags" title="enum PolkitAgentRegisterFlags"><span class="type">PolkitAgentRegisterFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> *subject</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *object_path</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-register-with-options" title="polkit_agent_listener_register_with_options ()">polkit_agent_listener_register_with_options</a>
                                                        (<em class="parameter"><code><a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitAgentListener.html#PolkitAgentRegisterFlags" title="enum PolkitAgentRegisterFlags"><span class="type">PolkitAgentRegisterFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> *subject</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *object_path</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *options</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-unregister" title="polkit_agent_listener_unregister ()">polkit_agent_listener_unregister</a>    (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> registration_handle</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="PolkitAgentListener.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----PolkitAgentListener
         +----<a class="link" href="PolkitAgentTextListener.html" title="PolkitAgentTextListener">PolkitAgentTextListener</a>
</pre>
</div>
<div class="refsect1">
<a name="PolkitAgentListener.description"></a><h2>Description</h2>
<p>
<a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> is an abstract base class used for implementing authentication
agents. To implement an authentication agent, simply subclass <a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> and
implement the <em class="parameter"><code>initiate_authentication</code></em> and <em class="parameter"><code>initiate_authentication_finish</code></em> methods.
</p>
<p>
Typically authentication agents use <a class="link" href="PolkitAgentSession.html" title="PolkitAgentSession"><span class="type">PolkitAgentSession</span></a> to
authenticate users (via passwords) and communicate back the
authentication result to the PolicyKit daemon.  This is however not
requirement. Depending on the system an authentication agent may
use other means (such as a Yes/No dialog) to obtain sufficient
evidence that the user is one of the requested identities.
</p>
<p>
To register a <a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> with the PolicyKit daemon, use
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-register" title="polkit_agent_listener_register ()"><code class="function">polkit_agent_listener_register()</code></a> or
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-register-with-options" title="polkit_agent_listener_register_with_options ()"><code class="function">polkit_agent_listener_register_with_options()</code></a>.
</p>
</div>
<div class="refsect1">
<a name="PolkitAgentListener.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="PolkitAgentListener-struct"></a><h3>PolkitAgentListener</h3>
<pre class="programlisting">typedef struct _PolkitAgentListener PolkitAgentListener;</pre>
<p>
The <a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> struct should not be accessed directly.
</p>
</div>
<hr>
<div class="refsect2">
<a name="PolkitAgentListenerClass"></a><h3>struct PolkitAgentListenerClass</h3>
<pre class="programlisting">struct PolkitAgentListenerClass {
  GObjectClass parent_class;

  /* Vtable */
  void     (*initiate_authentication)        (PolkitAgentListener  *listener,
                                              const gchar          *action_id,
                                              const gchar          *message,
                                              const gchar          *icon_name,
                                              PolkitDetails        *details,
                                              const gchar          *cookie,
                                              GList                *identities,
                                              GCancellable         *cancellable,
                                              GAsyncReadyCallback   callback,
                                              gpointer              user_data);

  gboolean (*initiate_authentication_finish) (PolkitAgentListener  *listener,
                                              GAsyncResult         *res,
                                              GError              **error);
};
</pre>
<p>
VFuncs that authentication agents needs to implement.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObjectClass"><span class="type">GObjectClass</span></a> <em class="structfield"><code><a name="PolkitAgentListenerClass.parent-class"></a>parent_class</code></em>;</span></p></td>
<td>The parent class.</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="PolkitAgentListenerClass.initiate-authentication"></a>initiate_authentication</code></em> ()</span></p></td>
<td>Handle an authentication request, see <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication" title="polkit_agent_listener_initiate_authentication ()"><code class="function">polkit_agent_listener_initiate_authentication()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="structfield"><code><a name="PolkitAgentListenerClass.initiate-authentication-finish"></a>initiate_authentication_finish</code></em> ()</span></p></td>
<td>Finishes handling an authentication request, see <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication-finish" title="polkit_agent_listener_initiate_authentication_finish ()"><code class="function">polkit_agent_listener_initiate_authentication_finish()</code></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-agent-listener-initiate-authentication"></a><h3>polkit_agent_listener_initiate_authentication ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                polkit_agent_listener_initiate_authentication
                                                        (<em class="parameter"><code><a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action_id</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *message</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *icon_name</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitDetails.html" title="PolkitDetails"><span class="type">PolkitDetails</span></a> *details</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *cookie</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Doubly-Linked-Lists.html#GList"><span class="type">GList</span></a> *identities</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
Called on a registered authentication agent (see
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-register" title="polkit_agent_listener_register ()"><code class="function">polkit_agent_listener_register()</code></a>) when the user owning the session
needs to prove he is one of the identities listed in <em class="parameter"><code>identities</code></em>.
</p>
<p>
When the user is done authenticating (for example by dismissing an
authentication dialog or by successfully entering a password or
otherwise proving the user is one of the identities in
<em class="parameter"><code>identities</code></em>), <em class="parameter"><code>callback</code></em> will be invoked. The caller then calls
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication-finish" title="polkit_agent_listener_initiate_authentication_finish ()"><code class="function">polkit_agent_listener_initiate_authentication_finish()</code></a> to get the
result.
</p>
<p>
<a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> derived subclasses imlementing this method
<span class="emphasis"><em>MUST</em></span> not ignore <em class="parameter"><code>cancellable</code></em>; callers of this
function can and will use it. Additionally, <em class="parameter"><code>callback</code></em> must be
invoked in the <GTKDOCLINK HREF="g-main-context-push-thread-default">thread-default main
loop</GTKDOCLINK> of the thread that this method is called from.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>A <a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>action_id</code></em> :</span></p></td>
<td>The action to authenticate for.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td>
<td>The message to present to the user.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>icon_name</code></em> :</span></p></td>
<td>A themed icon name representing the action or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>details</code></em> :</span></p></td>
<td>Details describing the action.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cookie</code></em> :</span></p></td>
<td>The cookie for the authentication request.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>identities</code></em> :</span></p></td>
<td>A list of <a class="link" href="PolkitIdentity.html" title="PolkitIdentity"><span class="type">PolkitIdentity</span></a> objects that the user can choose to authenticate as.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>Function to call when the user is done authenticating.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>Data to pass to <em class="parameter"><code>callback</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-agent-listener-initiate-authentication-finish"></a><h3>polkit_agent_listener_initiate_authentication_finish ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            polkit_agent_listener_initiate_authentication_finish
                                                        (<em class="parameter"><code><a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> *res</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Finishes an authentication request from the PolicyKit daemon, see
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication" title="polkit_agent_listener_initiate_authentication ()"><code class="function">polkit_agent_listener_initiate_authentication()</code></a> for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>A <a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>res</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> obtained from the <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> function passed to <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication" title="polkit_agent_listener_initiate_authentication ()"><code class="function">polkit_agent_listener_initiate_authentication()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Return location for error.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>error</code></em> is set.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="PolkitAgentRegisterFlags"></a><h3>enum PolkitAgentRegisterFlags</h3>
<pre class="programlisting">typedef enum {
  POLKIT_AGENT_REGISTER_FLAGS_NONE = 0,
  POLKIT_AGENT_REGISTER_FLAGS_RUN_IN_THREAD = (1&lt;&lt;0)
} PolkitAgentRegisterFlags;
</pre>
<p>
Flags used in <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-register" title="polkit_agent_listener_register ()"><code class="function">polkit_agent_listener_register()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="POLKIT-AGENT-REGISTER-FLAGS-NONE:CAPS"></a><span class="term"><code class="literal">POLKIT_AGENT_REGISTER_FLAGS_NONE</code></span></p></td>
<td>No flags are set.
</td>
</tr>
<tr>
<td><p><a name="POLKIT-AGENT-REGISTER-FLAGS-RUN-IN-THREAD:CAPS"></a><span class="term"><code class="literal">POLKIT_AGENT_REGISTER_FLAGS_RUN_IN_THREAD</code></span></p></td>
<td>Run the listener in a dedicated thread.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-agent-listener-register"></a><h3>polkit_agent_listener_register ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            polkit_agent_listener_register      (<em class="parameter"><code><a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitAgentListener.html#PolkitAgentRegisterFlags" title="enum PolkitAgentRegisterFlags"><span class="type">PolkitAgentRegisterFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> *subject</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *object_path</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Registers <em class="parameter"><code>listener</code></em> with the PolicyKit daemon as an authentication
agent for <em class="parameter"><code>subject</code></em>. This is implemented by registering a D-Bus
object at <em class="parameter"><code>object_path</code></em> on the unique name assigned by the system
message bus.
</p>
<p>
Whenever the PolicyKit daemon needs to authenticate a processes
that is related to <em class="parameter"><code>subject</code></em>, the methods
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication" title="polkit_agent_listener_initiate_authentication ()"><code class="function">polkit_agent_listener_initiate_authentication()</code></a> and
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-initiate-authentication-finish" title="polkit_agent_listener_initiate_authentication_finish ()"><code class="function">polkit_agent_listener_initiate_authentication_finish()</code></a> will be
invoked on <em class="parameter"><code>listener</code></em>.
</p>
<p>
Note that registration of an authentication agent can fail; for
example another authentication agent may already be registered for
<em class="parameter"><code>subject</code></em>.
</p>
<p>
Note that the calling thread is blocked until a reply is received.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>A <a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>A set of flags from the <a class="link" href="PolkitAgentListener.html#PolkitAgentRegisterFlags" title="enum PolkitAgentRegisterFlags"><span class="type">PolkitAgentRegisterFlags</span></a> enumeration.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subject</code></em> :</span></p></td>
<td>The subject to become an authentication agent for, typically a <a class="link" href="PolkitUnixSession.html" title="PolkitUnixSession"><span class="type">PolkitUnixSession</span></a> object.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object_path</code></em> :</span></p></td>
<td>The D-Bus object path to use for the authentication agent or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the default object path.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Return location for error.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>error</code></em> is set, otherwise a
registration handle that can be used with
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-unregister" title="polkit_agent_listener_unregister ()"><code class="function">polkit_agent_listener_unregister()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-agent-listener-register-with-options"></a><h3>polkit_agent_listener_register_with_options ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="returnvalue">gpointer</span></a>            polkit_agent_listener_register_with_options
                                                        (<em class="parameter"><code><a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a> *listener</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitAgentListener.html#PolkitAgentRegisterFlags" title="enum PolkitAgentRegisterFlags"><span class="type">PolkitAgentRegisterFlags</span></a> flags</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> *subject</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *object_path</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> *options</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Like <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-register" title="polkit_agent_listener_register ()"><code class="function">polkit_agent_listener_register()</code></a> but takes options to influence registration. See the
<a class="link" href="eggdbus-interface-org.freedesktop.PolicyKit1.Authority.html#eggdbus-method-org.freedesktop.PolicyKit1.Authority.RegisterAuthenticationAgentWithOptions" title="RegisterAuthenticationAgentWithOptions ()"><code class="function">RegisterAuthenticationAgentWithOptions()</code></a> D-Bus method for details.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>listener</code></em> :</span></p></td>
<td>A <a class="link" href="PolkitAgentListener.html" title="PolkitAgentListener"><span class="type">PolkitAgentListener</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>flags</code></em> :</span></p></td>
<td>A set of flags from the <a class="link" href="PolkitAgentListener.html#PolkitAgentRegisterFlags" title="enum PolkitAgentRegisterFlags"><span class="type">PolkitAgentRegisterFlags</span></a> enumeration.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subject</code></em> :</span></p></td>
<td>The subject to become an authentication agent for, typically a <a class="link" href="PolkitUnixSession.html" title="PolkitUnixSession"><span class="type">PolkitUnixSession</span></a> object.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>object_path</code></em> :</span></p></td>
<td>The D-Bus object path to use for the authentication agent or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the default object path.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>options</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> with options or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Return location for error.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>error</code></em> is set, otherwise a
registration handle that can be used with
<a class="link" href="PolkitAgentListener.html#polkit-agent-listener-unregister" title="polkit_agent_listener_unregister ()"><code class="function">polkit_agent_listener_unregister()</code></a>. <span class="annotation">[<a href="http://foldoc.org/transfer%20full"><span class="acronym">transfer full</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-agent-listener-unregister"></a><h3>polkit_agent_listener_unregister ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                polkit_agent_listener_unregister    (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> registration_handle</code></em>);</pre>
<p>
Unregisters <em class="parameter"><code>listener</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>registration_handle</code></em> :</span></p></td>
<td>A handle obtained from <a class="link" href="PolkitAgentListener.html#polkit-agent-listener-register" title="polkit_agent_listener_register ()"><code class="function">polkit_agent_listener_register()</code></a>.</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>